import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main.vue'
import Answer from '../views/Answer.vue'
import AnswerRecord from '../views/AnswerRecord.vue'
import QuestionList from '../views/QuestionList.vue'
import ReadingRules from '../views/ReadingRules.vue'
import InTheExam from '../views/InTheExam.vue'
import EndOfExam from '../views/EndOfExam.vue'
import AnswerList from '../views/AnswerList.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'main',
    // component: () => import(/* webpackChunkName: "about" */ '../views/Main.vue')
    component: Main,
    redirect: '/answer',
    children: [
      {
        path: 'answer',
        name: 'answer',
        component: Answer,
      },
      {
        path: 'answerRecord',
        name: 'answerRecord',
        component: AnswerRecord,
      },
      {
        path: 'questionList',
        name: 'questionList',
        component: QuestionList,
      },
      {
        path: 'readingRules',
        name: 'readingRules',
        component: ReadingRules,
      },
      {
        path: 'inTheExam',
        name: 'inTheExam',
        component: InTheExam,
      },
      {
        path: 'endOfExam',
        name: 'endOfExam',
        component: EndOfExam,
      },
      {
        path: 'answerList',
        name: 'answerList',
        component: AnswerList,
      },
    ],
  },
  // {
  // path: '/about',
  // name: 'about',
  // route level code-splitting
  // this generates a separate chunk (about.[hash].js) for this route
  // which is lazy-loaded when the route is visited.
  // component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  routes,
})

export default router
